{% extends "admin/base.html" %}
{% load pagination utils%}
{% block content %}
<div class="wrap">
 	<h2>用户管理</h2>
 		
 		<div class="clear"></div>
 		<table class="widefat">
			<thead>
				<tr>
				<th scope="col" class="check-column">
				<input type="checkbox" onclick="$('input[name=checks]').attr('checked',this.checked);"></th>
				<th>用户名</th>
				<th>名称</th>
				<th>EMAIL</th>
				<th>激活状态</th>
				<th>超级用户</th>
				<th class="num">最后登录时间</th>
				</tr>
			</thead>
			<tfoot>
				<tr>
				<th scope="col" class="check-column">
				<input type="checkbox" onclick="$('input[name=checks]').attr('checked',this.checked);"></th>
				<th>用户名</th>
				<th>名称</th>
				<th>EMAIL</th>
				<th>激活状态</th>
				<th>超级用户</th>
				<th class="num">最后登录时间</th>
				</tr>
			</tfoot>
			<tbody>
         {%if users%}
         {% begin_pagination users page 12%}
         {%for user in users%}
		<tr valign="middle" id="post-{{entry.id}}">
			<th scope="row" class="check-column">
				<input type="checkbox" name="checks" value="{{entry.id}}">
			</th>
			<td> 
				<img width="32" height="32" class="avatar avatar-32 photo" src="{% gravator user.email %}" alt="" style="float:left;margin-top:3px;margin-right:10px;">
             	<strong>
             			<a href="#">{{user.username}}</a>
             	</strong>
             	<div class="row-actions">
              	<span> <a href="/admin/editpost/{{entry.id}}?entrytype=post" title="Edit &quot;{{entry.title}}&quot;">编辑</a></span>
              	<span class="delete">| <a href="/admin/delpost?id={{entry.id}}">删除</a></span>
             	</div>
         </td>
         <td>{{user.first_name}} {{user.last_name}}</td>
         <td>{{user.email}}</td>
         <td>{{user.is_active}}</td>
         <td>{{user.is_superuser}}</td>
         <td class="num">{{user.last_login|date:"Y-m-d H:i:s"}}</td>
		</tr>
		{%endfor%}
		{%else%}
		<tr>
			<td colspan="7" align="center" style="font-size: 16px;">还没有新文章,<a href="/admin/post">添加</a>一篇吧</td>
		</tr>
		{%endif%}
			</tbody>
		</table>
 	{%if users%}
 	{% end_pagination %}
 	{%endif%}
</div>
{%endblock%}